<?php $this->start('admin_menu')?>
	<?php echo $this->element('admin_menu', array('str_item' => 'products')) ?>
<?php $this->end(); ?>

<div class="optionTypes form">
<?php echo $this->Form->create('OptionType'); ?>
	<h2><?php echo __('Option Types Management - Edit Option Type'); ?></h2>
	<?php 
		echo $this->Session->flash(); 
		echo $this->Session->flash('good');
		echo $this->Session->flash('bad');
	?>

	<?php echo $this->Form->input('id'); ?>
	<table class="form-table">
		<tr>
			<td class='l-style'><?php echo __('Name') ?><span class='star-rq'> * </span></td>
			<td class="r-style width_middle"><?php echo $this->Form->input('name', array('label' => false, 'class' => 'required')); ?></td>
		</tr>
		<tr>
			<td class='l-style'><?php echo __('Description') ?></td>
			<td class="r-style width_middle"><?php echo $this->Form->input('description', array('label' => false)); ?></td>
		</tr>
		<tr>
			<td class='l-style'><?php echo __('Option Values') ?></td>
			<td class="r-style width_middle">
				<div class="opt-value-dv" id="wrapper-opt-val" style="display: block; ">
					<table class="opt-val-tb" id="option-value">
						<tr>
							<th><?php echo __('Value') ?></th>
							<th><?php echo __('Delete') ?></th>
						</tr>
						<?php foreach($this->data['OptionValues'] as $value) {?>
							<?php if(isset($value['id'])){ ?>
								<tr>
									<td width="70%" class="width_full">
										<?php echo $this->Form->input('OptionValues.'.$value['id'].'.id', array('value' => $value['id'])); ?>
										<?php echo $this->Form->input('OptionValues.'.$value['id'].'.name', array('class' => 'required', 'label' => false, 'value' => $value['name'])); ?>
									</td>
									<td class="action-cm"><a href="#" onclick="removed(this);" class="act-lk del-link required"><?php echo __('Delete') ?></a></td>
								</tr>
							<?php } ?>
						<?php } ?>
					</table>
					<span class="add-more-link" id="add-more-link"><?php echo __('Add more value') ?></span>
				</div>
			</td>
		</tr>
		<tr>
			<td class='l-style no-border no-background'>
				(<span class='red-star'>*</span>) <?php echo __('Required') ?>
			</td>
			<td class='r-style actions no-border no-background'><?php echo $this->Form->end(__('Submit')); ?></td>
		</tr>
	</table>
</div>
<div class='actionct'>
	<span class='btn-act'><span><?php echo  $this->Html->link(__('Back'), array('action' => 'index'), array('class' => 'back-act')); ?></span></span>
	<span class='btn-act'><span><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('OptionType.id')), array('class' => 'del-link'), __('Are you sure you want to delete # %s?', $this->Form->value('OptionType.id'))); ?></span></span>
</div>

<script type="text/javascript">
	var countOptionValue = 1000;
</script>

